package com.ww.wwojbackendjudgeservice.judge.codsandbox;

import com.ww.wwojbackendjudgeservice.judge.codsandbox.impl.ExampleCodeSandbox;
import com.ww.wwojbackendjudgeservice.judge.codsandbox.impl.RemoteCodeSandbox;
import com.ww.wwojbackendjudgeservice.judge.codsandbox.impl.ThirdPartyCodeSandbox;

/**
 * @author 15357
 * 代码沙箱工厂（根据字符串）
 */
public class CodeSandboxFactory {

    public static CodeSandbox newInstance(String type) {
        switch(type) {
            case "example":
                return new ExampleCodeSandbox();
            case "remote":
                return new RemoteCodeSandbox();
            case "thirdParty":
                return new ThirdPartyCodeSandbox();
            default:
                return new ExampleCodeSandbox();
        }
    }
}
